package com.oncliedisk.administrator.utils;

import android.view.View;

/**
 * Created by Administrator on 2015/12/4.
 */
public class FileUtils {
    /**
     * 获取View的宽高
     * @param view
     * @return
     */
    public static int [] getWidthAndHeightforView(View view) {
        int [] i = new int[2];
        int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
        int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
        view.measure(w, h);
        i[0]= view.getMeasuredWidth();
        i[1] = view.getMeasuredHeight();
        return i;
    }
}
